package com.zbkj.dal.entity.user;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zbkj.dal.base.enums.FundStatusEnums;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 用户余额记录表
 * </p>
 *
 * @author HZW
 * @since 2022-10-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("eb_user_balance_record")
@ApiModel(value = "UserBalanceRecord对象", description = "用户余额记录表")
public class UserBalanceRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "记录id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "用户uid")
    private Integer uid;

    /**
     * 资金账户号
     */
    @TableField("fund_account")
    private String fundAccount;

    /**
     * 账户类型
     *
     * @see com.zbkj.dal.base.enums.FundAccountType
     */
    @TableField("account_type")
    private String accountType;

    /**
     * 账期
     */
    @TableField("bill_date")
    private Integer billDate;

    @ApiModelProperty(value = "关联id(订单号、充值单号)(system默认为0）")
    private String linkId;

    @TableField("image")
    private String image;

    @ApiModelProperty(value = "关联类型:order-订单,recharge-充值,system-系统,brokerage-佣金转余额")
    private String linkType;

    /**
     * @see com.zbkj.dal.base.enums.FundDirectionEnums
     */
    @ApiModelProperty(value = "类型：1-增加，2-扣减")
    private Integer type;

    @ApiModelProperty(value = "金额")
    private BigDecimal amount;

    /**
     * 状态
     * @see FundStatusEnums
     */
    @TableField("status")
    private String status;

    /**
     * 总余额
     */
    @TableField("total_amount")
    private BigDecimal totalAmount;

    /**
     * 可用余额
     */
    @TableField("available_amount")
    private BigDecimal availableAmount;

    /**
     * 在途余额
     */
    @TableField("freeze_amount")
    private BigDecimal freezeAmount;

    @ApiModelProperty(value = "剩余")
    private BigDecimal balance;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "添加时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    private LocalDateTime updateTime;

    /**
     * 是否删除
     */
    @TableField("is_deleted")
    private Integer deleted;


}
